package com.ruoyi.user.service.impl;

import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.user.domain.FamilyAudio1;
import com.ruoyi.user.mapper.FamilyAudio1Mapper;
import com.ruoyi.user.service.IFamilyAudio1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 家庭音频Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyAudio1ServiceImpl implements IFamilyAudio1Service
{
    @Autowired
    private FamilyAudio1Mapper familyAudio1Mapper;

    /**
     * 查询家庭音频
     * 
     * @param id 家庭音频主键
     * @return 家庭音频
     */
    @Override
    public FamilyAudio1 selectFamilyAudioById(Long id)
    {
        return familyAudio1Mapper.selectFamilyAudioById(id);
    }

    /**
     * 查询家庭音频列表
     * 
     * @param familyAudio1 家庭音频
     * @return 家庭音频
     */
    @Override
    public List<FamilyAudio1> selectFamilyAudioList(FamilyAudio1 familyAudio1)
    {
        return familyAudio1Mapper.selectFamilyAudioList(familyAudio1);
    }

    /**
     * 新增家庭音频
     * 
     * @param familyAudio1 家庭音频
     * @return 结果
     */
    @Override
    public int insertFamilyAudio(FamilyAudio1 familyAudio1)
    {
        familyAudio1.setCreateTime(DateUtils.getNowDate());
        return familyAudio1Mapper.insertFamilyAudio(familyAudio1);
    }

    /**
     * 修改家庭音频
     * 
     * @param familyAudio1 家庭音频
     * @return 结果
     */
    @Override
    public int updateFamilyAudio(FamilyAudio1 familyAudio1)
    {
        familyAudio1.setUpdateTime(DateUtils.getNowDate());
        return familyAudio1Mapper.updateFamilyAudio(familyAudio1);
    }

    /**
     * 批量删除家庭音频
     * 
     * @param ids 需要删除的家庭音频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyAudioByIds(Long[] ids)
    {
        return familyAudio1Mapper.deleteFamilyAudioByIds(ids);
    }

    /**
     * 删除家庭音频信息
     * 
     * @param id 家庭音频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyAudioById(Long id)
    {
        return familyAudio1Mapper.deleteFamilyAudioById(id);
    }
}
